<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 首页控制器
 */
class Index extends AdminBase
{
    
    /**
     * 首页方法
     */
    public function index()
    {
        
        // 获取首页数据
        $index_data = $this->logicAdminBase->getIndexData();

        // $list=$this->logicMyActivityRecord->getMyActivityRecordList();
        // sf($list);
        // sf($list[0]['activity_type']);
        $this->assign('info', $index_data);

         $where = [];
        
        $this->assign('article_list', $this->logicArticle->getArticleListForView($where, 'a.*,m.nickname,c.name as category_name', 'a.create_time desc'));
        $this->assign('healthroomNumber',count($this->logicHealthroom->getHealthroomListForCount()));//小屋数量
        $this->assign('expertNumber',$this->logicExpertinroom->getExperListForCount());//专家数量
        $this->assign('hospitalNumber',$this->logicHealthroom->getHospitalListForCount());//拥有小屋医院数量
        $this->assign('personNumber',$this->logicActivity->getPersonListForCount());//拥有小屋医院数量

        //区县小屋数量对比
        $this->assign('clist',$this->logicHealthroom->getHealthroomCount());
        //全市小屋增长率
        $this->assign('ilist',$this->logicHealthroom->getHealthroomIncrease());
        //区县小屋服务水平对比
        $this->assign('slist',$this->logicHealthroom->getHealthroomServiceLevel());
        
        return $this->fetch('index');
    }
}
